package com.qiang.test01;

import java.io.File;
import java.io.IOException;

public class Demo01 {
    public static void main(String[] args) throws IOException {
        /*File file = new File("day12\\text.java");
        System.out.println(file.createNewFile());
        boolean delete = file.delete();
        System.out.println(delete);*/

        /*//创建文件夹
        File file = new File("day12\\test");
        System.out.println(file.mkdir());

        //创建文件夹中的文件夹
        File file1 = new File(file, "\\test01");
        System.out.println(file1.mkdirs());

        //创建文件夹最里面的文件
        File file2 = new File(file1, "\\Demo.java");
        System.out.println(file2.createNewFile());

        //删除文件
        boolean delete = file2.delete();
        //System.out.println(delete);

        //删除文件夹
        boolean delete1 = file1.delete();
        //System.out.println(delete1);

        //删除文件夹
        boolean delete2 = file.delete();
        System.out.println(delete2);*/

        /*boolean directory = file.isDirectory();
        boolean directory1 = file1.isDirectory();
        boolean directory2 = file2.isDirectory();
        boolean file3 = file2.isFile();

        System.out.println(directory);
        System.out.println(directory1);
        System.out.println(directory2);
        System.out.println(file3);
        boolean exists = file2.exists();
        System.out.println(exists);
        File[] files = file.listFiles();
        System.out.println(files);*/


        //在本项目下，创建文件夹和文件

        /*File file = new File("day12\\test");
        if (!file.exists()) {
            file.mkdir();
        }

        File file1 = new File(file, "\\java.text");
        if(!file1.exists()){
            file1.createNewFile();
        }*/


    }
}
